<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #app{
            width: 50px;
            height: 50px;
            background-color: aquamarine;


            /* 超出打点 */
            /* white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis; */

            /* 三行显示 */
            /* display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden; */

            position: relative;
            line-height: 1.4em;
            overflow: hidden;
        }

        #app::after{
            content: '...';
            
        }
    </style>
</head>
<body>
    <div id="app">
        dsjahjdshjdjsajsjdjsjjslskkslksksks
    </div>
    <script>
        let app = document.getElementById('app')

        app.addEventListener('click', () => {
            console.log(this);
        })

        app.attachEvent('onclick', function(e) { // IE8以下的
            console.log(this); // window
            e.stopPropagation();
            
        })
    </script>
</body>
</html>